<template>
  <div>
    <h1>Header</h1>
    <hr />
    <p>count:{{ count }}</p>
    <button @click="changeCount">count++</button>
    <button @click="emits('changeNum', 5)">自定义事件</button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Header",
});
</script>

<script setup lang="ts">
const props = defineProps<{
  count: number;
  a: string;
  changeCount: () => void;
}>();
console.log(props.count);

// 接受自定义事件
const emits = defineEmits<{
  (event: "changeNum", value: number): void;
}>();
</script>

<style  scoped >
</style>